package cn.com.cabinet.service;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cabinet.service.IUserLoginService;
import com.cabinet.service.IUserService;
import com.cabinet.web.entity.User;

import cn.com.cabinet.dao.UserDao;
import cn.com.cabinet.dto.UserDto;


@Service
public class UserServiceImpl {
	/*@Autowired
	private UserDao udao;*/
	@Autowired
	private IUserService iUserService;
	@Autowired
	private IUserLoginService iUserLoginService;
	
	public UserDto getUser(Long id){
		UserDto udto = new UserDto();
		User u = iUserService.getUser(id);
		BeanUtils.copyProperties(u, udto);
		return udto;
	}
	
	public Boolean userLogin(String account, String password) {
		return iUserLoginService.userLogin(account, password);
	}
	
	public User getUser(String account , String password){
		return iUserService.GetUserByAccountAndPassword(account, password);
		//return wudao.getUserByUserAccountAndUserPassword(account, passwordS);
		
	}
}
